#ifndef SEU_MYSTR_H
#define SEU_MYSTR_H

typedef struct {
   char *s;
   long len;
   long maxlen;
} mystr;


int isInt(char c); //0-9

char *mysubstr(char *s, int b, int len); //string, beginning, end
//ie: sustr("apple", 1, 1) == 'p'
//    sustr("012345", 3, 2) == "34"

mystr *mystrcats(mystr *a, char *b);  // Concats b to a, resizing a if necessary
mystr *mystrcat(mystr *a, mystr *b);
int mystrStartsWith(char *str, char *fragment);
char *strtolower(char *str);

/* urlencode - Given a buffer of raw data of a given size, this function
 *             returns a NULL-terminated string in proper percent-encoded
 *             format.
 * params:
 *    source - A pointer to the start of the buffer of data
 *    len    - The length of the source buffer in bytes
 */
char *urlencode(unsigned char *source, int len); // new string is malloc'd, free it!
char *randUrlStr(unsigned int length);
char *numUrlStr(unsigned int num, unsigned int len);
int rawstrcmp(unsigned char *l, unsigned char *r, int len);

void mystrfree(mystr *s);

#endif

